import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/user/login',
    method: 'post',
    data
  })
}
export function createUser(data) {
  return request({
    url: '/user/createUser',
    method: 'post',
    data
  })
}

export function getOneUser(fileName) {
  return request({
    url: '/user/getOneUser',
    method: 'get',
    params: { fileName }
  })
}
export function getOneUserPassword(fileName) {
  return request({
    url: '/user/getOneUserPassword',
    method: 'get',
    params: { fileName }
  })
}
export function getOneUserName(fileName) {
  return request({
    url: '/user/getOneUserName',
    method: 'get',
    params: { fileName }
  })
}
export function updateUser(user) {
  return request({
    url: '/user/updateUser',
    method: 'post',
    data: user
  })
}

export function listUser(params) {
  return request({
    url: '/user/UserList',
    method: 'get',
    params
  })
}

export function getInfo() {
  return request({
    url: '/user/info',
    method: 'get'
  })
}

export function getPlan() {
  return request({
    url: '/user/plan',
    method: 'get'
  })
}

export function logout() {
  return request({
    url: '/user/logout',
    method: 'post'
  })
}
export function deleteUser(id) {
  return request({
    url: '/user/deleteUser',
    method: 'get',
    params: { id }
  }) 
}
export function updatePasswordUser(user) {
  return request({
    url: '/user/updatePasswordUser',
    method: 'post',
    data: user
  })
}
export function updatePasswordUser1(user) {
  return request({
    url: '/user/updatePasswordUser1',
    method: 'post',
    data: user
  })
}
export function sendMail(user) {
  return request({
    url: '/user/sendEmail',
    method: 'post',
    data: user
  })
}

export function adminInfo() {
  return request({
    url: '/user/adminInfo',
    method: 'get'
  })
}

export function enrollInfo(fileName) {
  return request({
    url: '/user/enrollInfo',
    method: 'get',
    params: { fileName }
  })
}